<template>
<view class="container">
	<view class="newslist" v-for="(item,index) in list" :key="index">
		<view class="title">
			<view class="detail">
				<view class="pic">
					<image :src="item.avatar"></image>
				</view>
				<view class="info">
					<view>{{item.nickname}} <text class="time">{{item.type}}</text>
					</view>
					<view> {{item.remark}}</view>
					<view class="jobmoney">审核通过可获得:<text>{{item.score}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</view>
</template>
<script>
import request from '@/util/request.js'
export default {
	data() {
		return{
			count:0,
			list:[],
			page:1,
			pageShow:true,
		}
	},
	onLoad:function() {
		uni.showLoading({
		    title: '加载中'  
		});
		this.getList();
	},
	methods: {
		getList:function(){
			var that = this;
			var data = {
				uid:uni.getStorageSync('uid'),
				page:this.page
			}
			request({
				url: 'money/unearned',
				method: 'get',
				data:data,
				success: (res) => {
					uni.hideLoading();
					if(res.data.code == 1){
						if(res.data.data.last_page <= that.page){
							that.pageShow = false
						}
						if(that.page == 1){
							that.list = res.data.data.data
						}else{
							var list = that.list
							that.list = list.concat(res.data.data.data)
						}
					}
				}
			})
		},
		onReachBottom: function(){
			if(this.pageShow){
				 //当前不是最后一页可加载
				 this.page = this.page + 1
				 uni.showLoading()
				 this.getlist();
			}
		},
	}
}
</script>

<style>
.container {
    background-color: #f5f5f5;
    min-height: 100%;
}
.newslist {
    display: flex;
    flex-direction: row;
    width: 720rpx;
    margin: 0 auto;
    border-bottom: 5rpx solid #efefef;
    padding-top: 10rpx;
    padding-bottom: 10rpx;
}
.title {
    width: 100%;
    flex-direction: column;
    display: flex;
    justify-content: space-between;
}
.detail {
    padding-left: 2%;
    text-align: left;
    font-size: .8rem;
    color: #000;
    display: flex;
    flex-direction: row;
    width: 100%;
}
.pic {
    width: 20%;
    display: flex;
    align-items: center;
}
.pic image {
    width: 120rpx;
    height: 120rpx;
    align-self: center;
    border-radius: 60rpx;
}
.info {
    width: 75%;
}
.time {
    color: #ff4129;
    font-size: .7rem;
}
.jobmoney {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    color: #646464;
}
.info view:nth-child(1) {
    padding-top: 10rpx;
    color: #646464;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.info view:nth-child(2) {
    padding-top: 10rpx;
    padding-bottom: 10rpx;
    color: #646464;
    font-size: .7rem;
}
.detail view:nth-child(3) {
    padding-top: 10rpx;
    font-weight: bold;
    font-size: .7rem;
    padding-right: 10rpx;
}
</style>